using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace BaseData.Models.Mapping
{
    public class V1_Web_Base_Accounts_Log_MessageMap : EntityTypeConfiguration<V1_Web_Base_Accounts_Log_Message>
    {
        public V1_Web_Base_Accounts_Log_MessageMap()
        {
            // Primary Key
            this.HasKey(t => new { t.PkId, t.AccId, t.AccIdType, t.FromId, t.FromIdType });

            // Properties
            this.Property(t => t.PkId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.AccId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.AccIdType)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FromId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FromIdType)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("V1_Web_Base_Accounts_Log_Message");
            this.Property(t => t.PkId).HasColumnName("PkId");
            this.Property(t => t.AccId).HasColumnName("AccId");
            this.Property(t => t.AccIdType).HasColumnName("AccIdType");
            this.Property(t => t.FromId).HasColumnName("FromId");
            this.Property(t => t.FromIdType).HasColumnName("FromIdType");
            this.Property(t => t.Title).HasColumnName("Title");
            this.Property(t => t.Content).HasColumnName("Content");
            this.Property(t => t.CreateIP).HasColumnName("CreateIP");
            this.Property(t => t.CreateDateTimes).HasColumnName("CreateDateTimes");
            this.Property(t => t.flagStatus).HasColumnName("flagStatus");
        }
    }
}
